home *** CD-ROM | disk | FTP | other *** search
/ FishMarket 1.0 / FishMarket v1.0.iso / fishies / 201-225 / disk_202 / vlt / rexx / amiga_to_ibm.vlt < prev    next >
Text File  |  1992-05-06  |  4KB  |  163 lines

  1. /* this is a test for a window which pulls stuff */
  2. check = addlib('rexxsupport.library',0,-30)  
  3. check = addlib('rexxarplib.library',0,-30)  
  4. check = addlib('rexxmathlib.library',0,-30) 
  5.  
  6. host = address()
  7.  
  8. ft = 'temp'
  9. fm = 'a'
  10.  
  11.     msgstring =            "   This routine sends a file to    \"
  12.     msgstring = msgstring||"   the IBM mainframe.  To select   \"
  13.     msgstring = msgstring||"   a file to send simply use the   \"
  14.     msgstring = msgstring||"   file requestor up above.        \"
  15.     msgstring = msgstring||"   If you hit CANCEL the transfer  \"
  16.     msgstring = msgstring||"   terminates.  The same happens   \"
  17.     msgstring = msgstring||"   if you fail to choose anything  \"
  18.     msgstring = msgstring||"   and hit OK.                   "
  19.  
  20.     y = postmsg(326,178,msgstring,host)
  21. done = 0
  22. do outer = 1 until done = 1
  23.  
  24.  
  25.   filerep = getfile(326,56,,,"CLICK DIRECTORY AND/OR FILE",host)
  26. /* this checks to see that not everything is blank. */
  27.  
  28.   if filerep = '' then do
  29.       x=postmsg()
  30.       exit
  31.   end
  32.  
  33. /* here we check to see that we got a file and not just a directory */
  34.  
  35.   dircheck = statef(filerep)
  36.   dirnum = index(dircheck,"DIR")
  37.   if dirnum ~= 0 then do
  38.     msgstring =            "   The name of the file itself \"
  39.     msgstring = msgstring||"   should appear in the lower  \"
  40.     msgstring = msgstring||"              box.             \"
  41.     msgstring = msgstring||"                               \"
  42.     msgstring = msgstring||"           TRY AGAIN           \"
  43.     msgstring = msgstring||"     (click left mouse button) \"
  44.    
  45.     y = postmsg(,,msgstring,host)
  46.     iterate outer
  47.   end
  48.  
  49.     x=postmsg()
  50.  
  51.     parse var filerep dir ":" filerep
  52.     if filerep = "" then do
  53.      filerep = dir
  54.      dir = ":"
  55.     end 
  56.     else dir = dir":"
  57.     filerep = reverse(filerep)
  58.     parse var filerep filename "/" subdir
  59.     filename = reverse(filename)
  60.      
  61.     sendfile = dir||reverse(filerep)
  62.     
  63.     parse var filename xfn"."xft
  64.     if xft ~= "" then ft = xft
  65.  
  66.     
  67. fillstring = ""
  68.   fillstring = fillstring||"What do you wish it to be called\"
  69.   fillstring = fillstring||"on the main frame?\"
  70.   fillstring = fillstring||"The name shown below is the default\"
  71.   fillstring = fillstring||"To assign your own name type over it"
  72.  
  73. defaultname = xfn" "ft" a"
  74.  
  75. ibmname = request(326,56,fillstring,defaultname,"Send It","Cancel",host)
  76.  
  77. if ibmname = "" then exit
  78.  
  79. if ibmname ~= defaultname then do
  80.  
  81.   parse var ibmname ifn ift ifm
  82.   
  83.   select
  84.   
  85.     when ifn  = '' then ibmname = fn" "ft" "fm
  86.     when ifn ~= '' & ift = '' then ibmname = ifn" "ft" "fm
  87.     when ift ~= '' & ifm = '' then ibmname = ifn" "ift" "fm
  88.     otherwise ibmname = ifn" "ift" "ifm
  89.  
  90.   end 
  91.  
  92. end
  93. if host ~= "VLT" then x = screentofront("VLT")
  94.  
  95. if host ~= "VLT" then address VLT
  96.  
  97.        sendstring = "kermver4 receive "||ibmname" *R"
  98.        sendstring = '"'||sendstring||'"'
  99.  
  100.         SEND "*R"
  101.         call delay 100
  102.  
  103.     SEND "*X7"
  104.         call delay 50
  105.  
  106.     SEND "*R"
  107.         call delay 50
  108.     SEND "*R"
  109.  
  110.  
  111.         SEND sendstring
  112.         
  113.         call delay 100
  114.  
  115.         KS sendfile 
  116.  
  117.  
  118.         SEND "*R"
  119.  
  120.         call delay 50
  121.  
  122.         SEND "*R*R"
  123.  
  124.         call delay 50
  125.  
  126.         SEND "*R"
  127.  
  128.         SEND "*R"
  129.  
  130.         SEND "*N"       
  131.  
  132.     done = 1
  133.  
  134. end
  135.  
  136. if host ~= "VLT" then x = screentoback("VLT")
  137. exit
  138.  
  139. ERROR:
  140.  
  141.    say "There has been an error somewhere "
  142.    exit 20
  143.  
  144. SYNTAX:
  145.    say "Syntax error"
  146.    exit 20
  147.  
  148.  
  149. NOVALUE:
  150.    say "Novalue error"
  151.    exit 20
  152.  
  153. HALT:
  154.  
  155.    say "External Halt detected"
  156.    exit 20
  157.  
  158. BREAK:
  159.  
  160.   say "Control C detected"
  161.   exit 20
  162.  
  163.